<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <style>

    </style>
</head>
<body>
<button id="btnget">模拟登录</button>
<script>

  $(function() {
        $('#btnget').on('click',function() {
            let obj={"username":"元气喵喵仙","password":"lyq666"};
            $.ajax({
                type: "POST",
                url: "http://localhost:8080/user/login",
                dataType: "json",
                data: JSON.stringify(obj),
                contentType: "application/json",
                success:function(msg){
                    console.log(msg);
                }
            })
        })
    })



</script>

</body>
</html>